package com.wbc.smartHome.util;

import com.wbc.smartHome.model.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {
    /*统一异常处理*/
    @ExceptionHandler(Exception.class)
    public Result globalException(Exception e) {
        e.printStackTrace();
        Result result = new Result(500,e.getMessage(),null);
        return result;
    }
}
